{% extends 'GlpmrQuizzBundle:Layout:layout.html.twig' %}

{% block body %}
    <h1>Modifier un quizz</h1>
    <br /><br />

    {% if confirm is defined %}
        {% if confirm == "OK" %}
            <h3>Quizz modifi&eacute; avec succ&egrave;s</h3>
        {% else %}
            <h3>Erreur lors de la modif</h3>
        {% endif %}
    {% endif %}

    <div class="row">
        <form method="POST" action="{{ path('glpmr_quizz_modifier', {'id': quizz.id}) }}">
            <div class="input-field col s12 l6">
                <label for="titre" class="inline form">Titre : </label>
                <input type="text" name="titre" id="titre" value="{{ quizz.titre }}" class="validate"/>
            </div>
            <div class="col s12 l6 selectModifier">
                <label>Promotion : </label>
                <select name="promotion" id="promotion">
                    <option value="{{ quizz.promotion.libelle }}" selected>{{ quizz.promotion.libelle }}</option>
                    {% for promo in promotions %}
                        <option value="{{ promo.libelle }}">{{ promo.libelle }}</option>
                    {% endfor %}
                </select>

            </div>
            <div class="divider"></div>
            <div class="input-field col s12">
                <label for="description" class="inline form">Description : </label>
                <textarea name="description" id="description" rows="1" class="materialize-textarea">{{ quizz.description }}</textarea>
            </div>
            <div class="divider"></div>
            <div class="input-field col s12 l5">

                <input id="etat" type="checkbox" name="etat" {% if quizz.etat == true %} checked="checked" {% endif %}/>

                <label for="etat">: Actif (rend disponible aux utilisateurs)</label>
            </div>
            <div class="divider"></div>
            <div class="col s12 l6">
                <button type="submit" class="btn blue-grey darken-4">Envoyer</button>
            </div>
        </form>
    </div>

{% endblock %}
